<template>
  <el-checkbox ref="chk" v-model="chkValue" @change="valUpdated" active-color="#13ce66" inactive-color="#ff4949"></el-checkbox>
</template>
<script>
import Vue from 'vue'

export default {
  data() {
    return { chkValue: true, cancelBeforeStart: true }
  },
  methods: {
    getValue() {
      return this.chkValue
    },
    isCancelBeforeStart() {
      return this.cancelBeforeStart
    },
	valUpdated(val){
	  if (this.params.cellUpdateHandler) {
        this.params.cellUpdateHandler(val)
      }
	}
  },
  created() {
    this.chkValue = this.params.value
    this.cancelBeforeStart = false
  },
  mounted() {
    Vue.nextTick(() => {
      //this.$refs.chk.focus()
    })
  }
}
</script>
